package 第四轮工作.山西大学;

import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import java.io.IOException;

public class SXu {
    public static void main(String[] args) throws IOException {
        Connection connect = Jsoup.connect("http://e.a.sxu.edu.cn/szdw/yjsds/index.htm");
        Document post = connect.post();
        for (Element plist : post.getElementsByClass("plist")) {
//            System.out.println(plist.text());
            for (Element element : plist.getElementsByTag("a")) {
                Connection connect1 = Jsoup.connect("http://e.a.sxu.edu.cn/szdw/yjsds/" + element.attr("href"));
                Document post1 = connect1.post();
                for (Element news : post1.getElementsByClass("news")) {
                    System.out.println(news.getElementsByTag("span").text());
                }
            }

        }

    }
}
